import paths from "../../json/json.js";
class Popuplist {
    constructor() {
        this.init();
    }
}
$.extend(Popuplist.prototype, {
    init: function () {
        this.getjson();
        this.getBigAds();
        this.getAds();
    },
    getjson: function () {
        let topic = '';
        let html1 = '';
        let html = '';
        for (let attr in paths.beauty_shop_list) {
            topic = paths.beauty_shop_list[attr].topic;
            html1 = `  <dl class="beauty-shop-right-first" style="border-left-width: 0">
            <dd class="item-diamond png"><a href="#">${topic}</a></dd>`;
            for (let attr1 in paths.beauty_shop_list[attr].content) {
                html1 += `<dt><a href="#">${paths.beauty_shop_list[attr].content[attr1]}</a></dt>`
                //   console.log(paths.beauty_shop_list[attr].content[attr1]);
            };
            html1 += `</dl>`;
            // console.log(html1);
            html += html1;
            html1 = '';
        };
        document.querySelector('.beauty-shop-right').innerHTML = html;
    },
    getBigAds: function () {
        let html = '';
        for (let attr in paths.big_ads_pic) {
            html += ` <a href="#" class="big-ads-pic">
                <img src="${paths.big_ads_pic[attr]}"
                alt="">
            </a>`
        }
        $('.big-ads-content').html(html);
    },
    getAds: function () {
        let html = '';
        for (let attr in paths.ads) {
            html += `<li>
                    <a href="./second.html?i=${paths.ads[attr].id}"><img src="${paths.ads[attr].main_img}"alt="">
                        <p class="title unactive">新品上线，快来试试吧</p>
                    </a>
                <div class="bottom">
                    <span class="title1">${paths.ads[attr].main_topic}/span>
                    <span class="price">$${paths.ads[attr].price}</span>
                </div>
                </li>`
        }
        $('.ads-item').html(html);
    }

})

export default Popuplist;